package com.springsecurity.entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name = "evento")
public class Evento implements Serializable  {
		
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	@Column(name = "evento_id")
	private Long id;
	
	@Column(length=50)
	private String nome;
	
	@Temporal(TemporalType.DATE)  
	private Date data;
	
	@ElementCollection
    @CollectionTable(name = "album", joinColumns = {@JoinColumn(name="foto_id")})
	private List<Fotos> album = new ArrayList<Fotos>();
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getNome() {
		return nome;
	}
	public void setNome(String nome) {
		this.nome = nome;
	}
	public Date getData() {
		return data;
	}
	public void setData(Date data) {
		this.data = data;
	}
	public List<Fotos> getFotos() {
		return album;
	}
	public void setFotos(List<Fotos> fotos) {
		this.album = fotos;
	}

	
}
